<div class="subheader" ng-if="model.caseModel">
  <div class="fixed-container">
    <div class="btn-group pull-right">
      <button class="btn btn-default" ng-click="openEditor()" ng-if="model.caseModel.latestVersion" type="button">
        <i class="glyphicon glyphicon-edit icon-and-label"></i> {{'CASE.ACTION.OPEN-IN-EDITOR' | translate}}
      </button>
      <button class="btn btn-default" ng-click="useAsNewVersion()" ng-if="!model.caseModel.latestVersion" type="button">
        {{'CASE.ACTION.USE-AS-NEW-VERSION' | translate}}
      </button>
    </div>
    <div class="btn-group pull-right">
      <a class="btn btn-default" href="{{model.cmmnDownloadUrl}}" title="{{'CASE.ACTION.EXPORT_CMMN' | translate}}">
        <i class="glyphicon glyphicon-save"></i>
      </a>
    </div>
    <div class="btn-group pull-right">
      <button class="btn btn-default" ng-click="editCaseModel()" ng-disabled="!model.caseModel.latestVersion"
              title="{{'CASE.ACTION.EDIT' | translate}}"
              type="button">
        <i class="glyphicon glyphicon-pencil"></i>
      </button>
      <button class="btn btn-default" ng-click="duplicateCaseModel()" ng-disabled="!model.caseModel.latestVersion"
              title="{{'CASE.ACTION.DUPLICATE' | translate}}"
              type="button">
        <i class="editor-icon editor-icon-copy"></i>
      </button>
      <button class="btn btn-default" ng-click="deleteCaseModel()" ng-disabled="!model.caseModel.latestVersion"
              title="{{'CASE.ACTION.DELETE' | translate}}"
              type="button">
        <i class="glyphicon glyphicon-trash"></i>
      </button>
    </div>
    <div class="pull-right">
      <a class="action" ng-click="returnToList()">&larr; {{'GENERAL.ACTION.RETURN-TO-LIST' | translate}}</a>
    </div>
    <h2><span class="version">v{{model.caseModel.version}}</span>{{model.caseModel.name}}</h2>
    <div class="clearfix">
      <div class="col-xs-4 details">
        <span><i class="glyphicon glyphicon-user"></i>{{'CASE.DETAILS.CREATED-BY' | translate:model.caseModel}}</span>
        <span><i
                class="glyphicon glyphicon-pencil"></i>{{'CASE.DETAILS.LAST-UPDATED-BY' | translate:model.caseModel}}</span>
      </div>
      <div class="col-xs-8 details clearfix">
        <div class="related btn-group">
          <button class="btn btn-subtle" id="toggle-history" ng-click="toggleHistory($event)"
                  title="{{'CASE.ACTION.EDIT' | translate}}"
                  type="button">
            {{'CASE.DETAILS.HISTORY-TITLE' | translate}} <span class="counter" ng-show="model.versions.data.length">{{model.versions.data.length}}</span>
          </button>
        </div>
        <a class="pull-right action" ng-click="goToStencil()" ng-show="model.stencil">{{model.stencil.name}}</a>
        <p ng-if="model.caseModel.description">
          {{model.caseModel.description}}
        </p>
        <p class="hint" ng-if="!model.caseModel.description && model.caseModel.latestVersion">
          <a class="subtle-select" ng-click="editCaseModel()">
            {{'CASE.DETAILS.NO-DESCRIPTION' | translate}} <i class="glyphicon glyphicon-pencil"></i>
          </a>
        </p>
      </div>
    </div>
  </div>
</div>
<div auto-height class="content center-pane" ng-if="model.caseModel" offset="40">

  <div class="model-preview-wrapper" ng-if="model.caseModel.modelType && model.caseModel.modelType != 1">
    <div id="cmmnModel"></div>
  </div>
</div>
